Peripheral device for programmable controller

ABSTRACT

A storage unit stores ranges of devices allocated for each sequence program. A device range checking unit sequentially extracts device notations indicating consecutive areas and commands specifying consecutive devices present in a sequence program, expands devices of the corresponding consecutive areas, and checks whether or not devices of consecutive areas are within a range of devices stored in the storage unit. The device range checking unit sequentially extracts device notations indicating consecutive areas and commands specifying consecutive devices present in a sequence program, expands devices of the corresponding consecutive areas, and checks whether or not devices of consecutive areas are within a range of devices stored in the storage unit.

This is a divisional of application Ser. No. 09/643,954 filed Aug. 23,2000 and issued as U.S. Pat. No. 6,810,433; the disclosure of which isincorporated herein by reference.

This application is a continuation of International ApplicationPCT/JP99/00270, with an international filing date of Jan. 25, 1999,which designated the United States, the entire contents of which arehereby incorporated by references.

TECHNICAL FIELD

The present invention relates to a peripheral device used as aprogramming tool and the like for creating a sequence program for aprogrammable controller for controlling mechanical equipment. Moreparticularly, this invention relates to a peripheral device having afunction for checking a sequence program.

BACKGROUND ART

FIG. 18 shows a peripheral device for a programmable controller(hereinafter referred to as a PC peripheral device in some cases) in theconventional technology.

A PC peripheral device 300 is provided with a processing section 301formed by a CPU or the like, a main storage section 302, an auxiliarystorage section 303, a key input control section 304, a screen controlsection 305, and a printer control section 306. A keyboard 307 isconnected to the key input control section 304, a display unit 308formed by a CRT or the like is connected to the screen control section305, and a printer 309 is connected to the printer control section 306.

The main storage section 302 is allocated for a system program area 310,a sequence program area 311, and a device range information area 312. Asystem program is stored in the system program area 310, a sequenceprogram is stored in the sequence program area 311, and device rangeinformation is stored in the device range information area 312.

FIG. 19 shows a device allocation table of a PC peripheral device. Thedevice allocation table is stored in the device range information area312 and defines the range of each device. The device allocation tablecontains information such as points information 400 on each device, aswell as local device range information 401 and global device rangeinformation 402 for each device.

Note that a local device is a device allocated for each sequenceprogram, while a global device is a device common to all sequenceprograms.

The programmable controller peripheral device 300 stores sequenceprograms input by the keyboard 307 via the key input control section 304in the sequence program area 311 of the main storage section 302. Italso stores device range information in the device range informationarea 312 of the main storage section 302. The sequence programs anddevice range information stored in each area are output to the displayunit 308 via the screen control section 305 and to the printer 309 viathe printer control section 306, and are stored in the auxiliary storagesection 303.

Here, the sequence program and device range information will be taken asalready created and stored in the main storage section 302.

When checking as to whether or not there is an error in a value of adevice used in a sequence program, a check instruction is given usingthe keyboard 307 via the key input control section 304. Based on thischeck instruction, the processing section 301 executes a check routinein the system program. This check routine will be described below whilereferring to FIG. 20.

Based on the check instruction, processing is executed so that the dataof one command is acquired from the sequence program (step S301).Processing is then executed to check whether or not a device is beingused in the command (step S302).

If a device is included, processing to acquire the device number isexecuted (step S303). Processing is then executed to check whether ornot the device number exceeds the points of the device point information(step S304).

In this check, if the device number exceeds the points of the devicepoint information, error display processing is executed to report thatthe range is exceeded (step S305).

It is then verified whether or not the checking has been completed downto the final step (step S306), and the above processing sequence isrepeated as far as the final step.

As an example, when checking a sequence program such as that shown inFIG. 21, the checking is performed in sequence from the first command ofthe sequence program. When the third command is checked, “MOV K40 D9000”is acquired, and “D9000” is acquired as the device used in the command.

As shown in FIG. 22, the device “D9000” and the device range informationof the device D are compared, and a check is made as to whether or notthe device “D9000” is within the range of the points of the device D inthe device range information. As the points of the device D are “8191”,while the number of the device “D9000” is “9000”, the device “D9000” isoutside the range of the device D. Therefore, an error such as thatshown in FIG. 23 is displayed. In the error display, the command number(list line) where the command which uses the device that exceeds thedevice range is present as well as one command and device rangeinformation (maximum value) are displayed on the screen.

However, because the seventh “BMOV” command of the sequence programshown in FIG. 21 is a command for copying 10 groups of data startingfrom “D0” to 10 data areas starting from “D8190”, the ten groups of datastarting from the data transfer destination device “D8190” are form therange “D8190”-“D8199”. This exceeds the maximum value of the points ofthe device D, however, in a conventional PC peripheral device, becausewhether or not the data transfer destination device “D8190” is outsidethe device range is only being checked, no error results.

Further, in a conventional PC peripheral device, because it is notpossible to check whether or not devices connected by a device notationindicating consecutive areas and commands specifying consecutive devicespresent in the sequence program are local devices and global devicesused in combination, this check has to be performed by visuallyconfirming the sequence program. Such a check is extremely troublesomeand inconvenient, and errors in the operation of the programmablecontroller caused by mistakes in the checking may occur.

Furthermore, in a conventional PC peripheral device, because it is alsonot possible to check the checking as to whether or not devicesconnected by a device notation indicating consecutive areas and commandsspecifying consecutive devices present in the sequence program are usedsingly by other commands present in the sequence program, this check hasto be performed by an operator visually confirming the sequence program.Such a check is extremely troublesome and inconvenient, and errors inthe operation of the programmable controller caused by mistakes in thechecking may occur.

Furthermore, in a conventional PC peripheral device, because it is notpossible to check whether or not index modified results of commandsspecifying index modification devices present in the sequence programare used by other commands present in the sequence program, this checkhas to be performed by an operator visually confirming the sequenceprogram. Such a check is extremely troublesome and inconvenient, anderrors in the operation of the programmable controller caused bymistakes in the checking may occur.

The present invention has been achieved in order to solve the aboveproblems. It is an object of the present invention to provide aperipheral device for a programmable controller capable of performingeach of the checks below automatically, without the necessity of theconfirmation work of the sequence program itself by watching by anoperator. Namely, a check as to whether or not devices connected by adevice notation and commands specifying consecutive devices present in asequence program are local devices and global devices used incombination; and whether or not local devices and global devices arebeing used in combination in a device notation; a check as to whether ornot consecutive devices of commands specifying consecutive devicespresent in the sequence program are used alone by other commands presentin the sequence program; and a check as to whether or not index modifiedresults of commands specifying index modification devices present in thesequence program are used by other commands present in the sequenceprogram.

DISCLOSURE OF THE INVENTION

According to one aspect of the present invention, a peripheral devicefor a programmable controller comprises a storage unit which stores arange of a device allocated for each sequence program, and a devicerange checking unit which sequentially extracts device notationsindicating consecutive areas and commands specifying consecutive devicespresent in a sequence program, expands devices of correspondingconsecutive areas, and checks whether or not devices of consecutiveareas are within a range of devices stored in the storage unit.

Therefore, the device range checking unit sequentially extracts devicenotations indicating consecutive areas and commands specifyingconsecutive devices present on the sequence program, expands devices ofthe corresponding consecutive areas, and checks whether or not devicesof consecutive areas are within the range of devices stored in thestorage unit.

According to another aspect of the present invention, a peripheraldevice for a programmable controller comprises a storage unit whichstores device range information which defines a range of a local deviceallocated for each sequence program and a range of a global devicecommon to each sequence program; and a combined local device/globaldevice use checking unit which sequentially extracts device notationsindicating consecutive areas and commands specifying consecutive devicespresent in a sequence program, expands devices of correspondingconsecutive areas, and checks whether or not local devices and globaldevices are used in combination for devices of consecutive areas, byreferring to device range information stored in the storage unit.

Therefore, the combined local device/global device use checking unitsequentially extracts device notations indicating consecutive areas andcommands specifying consecutive devices present in a sequence program,expands devices of the corresponding consecutive areas, and checkswhether or not local devices and global devices are used in combinationfor devices of consecutive areas, by referring to device rangeinformation stored in the storage unit.

According to still another aspect of the present invention, a peripheraldevice for a programmable controller comprises a device overlapping usechecking unit which sequentially extracts notations indicatingconsecutive areas and commands specifying consecutive devices present ina sequence program, expands corresponding consecutive areas, and checksoverlapping use of devices by comparing devices of consecutive areaswith devices used by other commands present in an identical sequenceprogram.

Therefore, the device overlapping use checking unit sequentiallyextracts notations indicating consecutive areas and commands specifyingconsecutive devices present in the sequence program, expands thecorresponding consecutive areas, and checks overlapping use of devicesby comparing devices of consecutive areas with devices used by othercommands present in the identical sequence program.

According to still another aspect of the present invention, a peripheraldevice for a programmable controller comprises a device overlapping usechecking unit which sequentially extracts commands specifying indexmodification devices present in a sequence program, and checksoverlapping use of devices by comparing index modified result deviceswith devices used by other commands present in an identical sequenceprogram.

Therefore, the device overlapping use checking unit sequentiallyextracts commands specifying index modification devices present in thesequence program, and checks overlapping use of devices by comparingindex modified result devices with devices used by other commandspresent in the identical sequence program.

According to still another aspect of the present invention, a peripheraldevice for a programmable controller comprises a processing sectionformed by a CPU or the like, a main storage section allocated for asystem program area which stores a system program, a sequence programarea which stores a sequence program, and a device range informationarea, an auxiliary storage section, a key input control section, and ascreen control section, wherein device range information specifying adevice range is stored in the device range information area, and devicenotations indicating consecutive areas and commands specifyingconsecutive devices present in a sequence program are sequentiallyextracted by the processing section running a system program stored inthe system program area, devices of corresponding consecutive areas areexpanded, whether or not the consecutive devices are within a devicerange defined by device range information stored in the device rangeinformation area is checked, and a result is displayed on a display unitconnected to the screen control section.

Therefore, device notations indicating consecutive areas and commandsspecifying consecutive devices present in the sequence program aresequentially extracted by the processing section running the systemprogram, devices of the corresponding consecutive areas are expanded,whether or not the consecutive devices are within the device rangedefined by device range information stored in the device rangeinformation area is checked. The result is displayed on the display unitconnected to the display control section.

According to still another aspect of the present invention, a peripheraldevice for a programmable controller comprises a processing sectionformed by a CPU or the like, a main storage section allocated for asystem program area which stores a system program, and a sequenceprogram area which stores a sequence program, and a device rangeinformation area, an auxiliary storage section, a key input controlsection, and a screen control section, wherein device range informationwhich defines a range of a local device allocated for each sequenceprogram and a range of a global device common to each sequence programis stored in the device range information area, and device notationsindicating consecutive areas and commands specifying consecutive devicespresent in a sequence program in the sequence program area aresequentially extracted by the processing section running a systemprogram stored in the system program area, devices of consecutive areasare expanded based on the above extraction, whether or not local devicesand global devices are used in combination for the devices of theconsecutive areas is checked by referring to the device rangeinformation, and a result is displayed on a display unit connected tothe screen control section.

Therefore, device notations indicating consecutive areas and commandsspecifying consecutive devices present in the sequence program in thesequence program area are sequentially extracted by the processingsection running the system program, devices of the correspondingconsecutive areas are expanded, whether or not local devices and globaldevices are used in combination for the devices of the consecutive areasis checked by referring to the device range information. The result isdisplayed on the display unit connected to the display control section.

According to still another aspect of the present invention, a peripheraldevice for a programmable controller comprises a processing sectionformed by a CPU or the like, a main storage section allocated for asystem program area which stores a system program and a sequence programarea which stores a sequence program, an auxiliary storage section, akey input control section, and a screen control section, whereinnotations indicating consecutive areas and commands specifyingconsecutive devices present in a sequence program stored in the sequenceprogram area are sequentially extracted by the processing sectionrunning a system program stored in the system program area, devices ofcorresponding consecutive areas are expanded, overlapping use of devicesis checked by comparing devices of consecutive areas with devices usedby other commands present in an identical sequence program, and a resultis displayed on a display unit connected to the screen control section.

Therefore, notations indicating consecutive areas and commandsspecifying consecutive devices present in the sequence program stored inthe sequence program area are sequentially extracted by the processingsection running the system program, devices of the correspondingconsecutive areas are expanded, overlapping use of devices is checked bycomparing devices of consecutive areas with devices used by othercommands present in the identical sequence program. The result isdisplayed on the display unit connected to the display control section.

According to still another aspect of the present invention, a peripheraldevice for a programmable controller comprises a processing sectionformed by a CPU or the like, a main storage section allocated for asystem program area which stores a system program and a sequence programarea which stores a sequence program, an auxiliary storage section, akey input control section, and a screen control section, whereincommands specifying index modification devices present in a sequenceprogram stored in the sequence program area are sequentially extractedby the processing section running a system program stored in the systemprogram area, overlapping use of devices is checked by comparing indexmodified result devices with devices used by other commands present inan identical sequence program, and a result is displayed on a displayunit connected to the screen control section.

Therefore, commands specifying index modification devices present in thesequence program stored in the sequence program area are sequentiallyextracted by the processing section running the system program stored inthe system program area, overlapping use of devices is checked bycomparing index modified result devices with devices used by othercommands present in the identical sequence program. The result isdisplayed on the display unit connected to the display control section.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a peripheral device for a programmablecontroller according to an embodiment of the present invention;

FIG. 2 is a flow chart showing a device range in a peripheral device fora programmable controller of the present invention and a flow ofcombined local device/global device use checking processing;

FIG. 3 is a flow chart showing a processing flow of processing forfetching a device in a peripheral device for a programmable controllerof the present invention;

FIG. 4 is a view of a ladder circuit and list expression showing anexample of a sequence program for performing a combined localdevice/global device use check;

FIG. 5 and FIG. 6 are explanatory diagrams each showing examples of acombined local device/global device use check;

FIG. 7 is an explanatory diagram showing an example of a screen displayof a result of a combined local device/global device use check;

FIG. 8 is a flow chart showing a flow of processing of a first deviceoverlapping use check in a peripheral device for a programmablecontroller of the present invention;

FIG. 9 is a view of a ladder circuit and list expression showing anexample of a sequence program for performing a first device overlappinguse check in a peripheral device for a programmable controller of thepresent invention;

FIG. 10 and FIG. 11 are explanatory diagrams each showing an example ofa first device overlapping use check;

FIG. 12 is an explanatory diagram showing an example of a screen displayof a result of a first device overlapping use check;

FIG. 13 is a flow chart showing a flow of processing of a second deviceoverlapping use check in a peripheral device for a programmablecontroller of the present invention;

FIG. 14 is a flow chart showing a processing flow of processing toextract a minimum value and a maximum value of a retrieval device in aperipheral device for a programmable controller of the presentinvention;

FIG. 15 is a view of a ladder circuit and list expression showing anexample of a sequence program for performing a second device overlappinguse check;

FIG. 16 is an explanatory diagram showing an example of a second deviceoverlapping use check;

FIG. 17 is an explanatory diagram showing an example of a screen displayof a result of a second device overlapping use check;

FIG. 18 is a block diagram showing a conventional peripheral device fora programmable controller;

FIG. 19 is an explanatory diagram showing an example of device rangeinformation;

FIG. 20 is a flow chart showing a device check in a conventionalperipheral device for a programmable controller;

FIG. 21 is a view of a ladder circuit and list expression showing anexample of a sequence program for performing a conventional devicecheck;

FIG. 22 is an explanatory diagram showing an example of a conventionaldevice check; and

FIG. 23 is an explanatory diagram showing an example of a screen displayof a result of a conventional device check.

BEST MODE FOR CARRYING OUT THE INVENTION

The present invention will now be described in detail while referring tothe attached figures.

FIG. 1 is a block diagram of a peripheral device for a programmablecontroller according to the present invention. A PC peripheral device 10comprises a processing section 11 formed by a CPU or the like, a mainstorage section 12, an auxiliary storage section 13, a key input controlsection 14, a screen control section 15, and a printer control section16. A keyboard 17, a display unit 18 formed by a CRT or the like, and aprinter 19 are connected respectively to the key control section 14, thescreen control section 15, and the printer control section 16.

The main storage section 12 is allocated for a system program area 20, asequence program area 21, and a device range information area 22. Asystem program, a sequence program, and device range information arestored respectively in the system program area 20, the sequence programarea 21, and the device range information area 22.

In the same manner as a conventional device, the PC peripheral device 10stores sequence programs based on ladder expressions and listexpressions from the keyboard 17 via the key control section 14 in thesequence program area 21 of the main storage section 12. It also storesdevice range information in the device range information area 22 of themain storage section 12. The device range information may be the same asconventional device range information such as that shown in FIG. 19.

The PC peripheral device 10 also outputs sequence programs and devicerange information stored in the respective areas to the display unit 18via the screen control section 15 and to the printer 19 via the printercontrol section 16, and also stores it in the auxiliary storage section13.

A system program stored in the system program area 20 is provided with aprogram creation module 30 for the programming of a sequence program, adevice range and combined local device/global device use checking(identical attribute checking) module 31, a first device overlapping usechecking module 32, and a second device overlapping use checking module33.

The device range and combined local device/global device use checking(identical attribute checking) module 31 used for checking sequentiallyextracts device notations indicating consecutive areas and commandsspecifying consecutive devices present in the sequence program, expandsdevices of the relevant consecutive areas, checks whether or not devicesof consecutive areas are within the range of devices defined by thedevice range information stored in the device range information area 22,and also checks whether or not local devices and global devices are usedin combination for the devices of consecutive areas by referring to thedevice range information in the device range information area 22.

The first device overlapping use check module 32 sequentially extractsdevice notations indicating consecutive areas and commands specifyingconsecutive devices which is present in the sequence program, expandsdevices of the corresponding consecutive areas, and checks deviceoverlapping use by comparing devices of consecutive areas with devicesused by other commands which is present in the same sequence program.

The second device overlapping use checking module 33 sequentiallyextracts commands specifying index modification devices present in asequence program, and checks on device overlapping use by comparingindex modified result devices with devices used by other commands whichis present in the same sequence program.

When a check on whether devices connected by device notations indicatingconsecutive areas and commands specifying consecutive devices in asequence program are within the device range determined in advance bythe device range information is performed, and when a check on whetherconsecutive devices are local devices and global devices being used incombination is performed, a combined local device/global device usechecking instruction is output from the keyboard 17 via the key inputcontrol section 14. This instruction results in the processing section11 running the device range and combined local device/global device usechecking module 31 in the system program.

The check routine of the device range and combined local device/globaldevice use checking module 31 will now be explained while referring toFIG. 2.

When a check instruction is given, a processing to set the destinationof the reference by the sequence program copy source as the firstcommand is performed (step S1). The first command is then set as thedestination of the reference by the copy source. A processing to copyone command and device to a work area from the sequence program is thenperformed (step S2). By this processing one command and device arecopied to a work area.

A processing to determine whether the one command and device copied tothe first work area are a command specifying a device indicatingconsecutive areas or a device notation is then performed (step S3). Ifthe one command and device are neither a command specifying a deviceindicating consecutive areas or a device notation, a processing to setthe destination of the reference by the sequence program copy source tothe next command is performed (step S4). By this processing, thedestination of the reference by the sequence program copy source is setto the next command. The processing to copy one command and device fromthe sequence program to the work area (step S2) is then repeated.

If, however, the one command and device are a command specifying adevice indicating consecutive areas or a device notation, a processingto fetch the device is performed (step S5). With this process, thedevice alone is fetched from the one command and device.

The processing to fetch the device (device expansion processing) willnow be described while referring to FIG. 3.

A processing to disassemble one command and device into a characterstring following the command so that nulls (spaces) are used as keys andcharacter string groups with no spaces are created is performed (stepS21), thus forming respective device sections. A processing to determinewhether or not the first character of a character string is a notationof a device indicating consecutive areas (i.e. is “K” or not) is thenperformed (step S22). If the first character is “K”, a processing toextract the numerical values following “K” is performed (step S23). Bythis processing, the range of the consecutive devices acquired(expanded).

A processing to determine whether or not the device following “K” andthe numerical values is present is performed (step S24). If the deviceis present, a processing to extract the numerical values of the devicefollowing “K” and the numerical values is performed (step S25). By thisprocessing, the first of the consecutive devices is acquired.

A determination is then performed as to whether or not an extraction hasbeen performed for all of the character string groups (step S26). If anextraction has not been performed for all character string groups, theroutine is repeated from the processing to determine whether or not thefirst character of a character string is “K” (step S22).

Once extraction has been performed for all character string groups, aprocessing to determine whether or not the command is one specifying adevice that indicates consecutive areas (“BMOV”) is performed (stepS27). If the command is one specifying a device that indicatesconsecutive areas, a processing to acquire the number of the characterstring group indicating the consecutive areas from the data tablecorresponding to the command is performed (step S28). By thisprocessing, the device indicating the consecutive areas is acquired(expanded) from the data tables.

A processing to determine whether or not the first character of thecharacter string of the device is a character other than “K” is thenperformed (step S29). If the character is a character other than “K”, aprocessing to extract the device value is performed (step S30).

The processing to fetch the device is thus completed, and once theprocessing to fetch the device has been completed, a determination isthen performed (the description returns here to FIG. 2) as to whether ornot the devices of consecutive areas, extracted as described above, arewithin the device range defined by the device range information (stepS6).

If the devices of consecutive areas are not within the device rangedefined by the device range information, a processing to save theresults as printout data and screen display data is performed (step S9).By this processing, the print out data and screen display data arecreated and added.

If the devices of consecutive areas are within the device range definedby the device range information, a processing to fetch attributeinformation of the devices within the areas from the device rangeinformation with the devices of consecutive areas, extracted asdescribed above, processed first is performed (step S7). Local devicerange information and global device range information are thus acquired.

A processing to determine whether or not attributes within an area arethe same is then performed (step S8). Devices of consecutive areas arecompared with local device range information and global device rangeinformation. If the attributes are not the same, a processing to savethe results as printout data and screen display data is performed (stepS9). With this process, the print out data and screen display data arecreated and added.

A processing to determine whether or not the command is still present isthen performed (step S10). If the command is still present, theprocessing to set the destination of the reference by the sequenceprogram source to the next command is performed (step S4). Thedestination of the reference by the sequence program source is then setto the next command and the routine is repeated from the processing tocopy one command and device from the sequence program to the work area(step S2).

Once the check has finished for all the sequence programs, the savedresults (check results) are output to the CRT 18 via the screen controlsection 15 and to the printer 19 via the printer control section 16(step S11).

The output results comprise the command number (list line) where acommand specifying a device outside the device range is present and thecommand, the command number (list line) where a command specifying adevice notation for a local and global device used in combination anddevices indicating consecutive areas is present and the command, as wellas the location of the combined use and related device range information(normal local device ranges and global device ranges).

When the above-described check is performed for the sequence programshown in FIG. 4, the third command “MOV K4M92 D0” includes the devicenotation “K” indicating consecutive areas. In this command, as is shownin FIG. 5, the numerical value “4” following the first character “K” ofthe device section “K4M92 D0” following the command section “MOV” isextracted in the extraction processing, and the consecutive device range“K1 to “K4” is acquired.

The devices “M92” to “M107” are allocated to the range “K1” to “K4” ofthe consecutive devices. In this series of devices, the devices “M92” to“M99” are local devices and “M100” to “M107” are global devices relativeto the device attributes defined by the device range information.Therefore, it is determined that the notation of the device indicatingconsecutive areas in the third command is a mixture of local and globaldevices used together.

Further, the seventh command “BMOV D45 D10 K10” is a command indicatingconsecutive areas (a transfer command). Here, as is shown in FIG. 6,devices “D45” to “D54” indicating consecutive areas of the transfersource are acquired in accordance with this command. Note that devicesindicating consecutive areas of the destination of the transfer sourceare acquired in the same way, however, because no error occurs here,they have been omitted.

Because the devices “D45” to “D49” are local devices and “D50” to “M54”are global devices of the devices “D45” to “D54” indicating consecutiveareas relative to the device attributes defined by the device rangeinformation, it is determined that the seventh command which isindicating consecutive areas is a mixture of local and global devicesused together.

The result of this is that a check result, such as that shown in FIG. 7,is displayed on the screen.

Consequently, the check of whether or not a mixture of local devices andglobal devices are being used in combination in consecutive deviceshaving device notations indicating consecutive areas or commandsspecifying consecutive devices present in a sequence program does notrequire the task of visually verifying the sequence program itself, andcan be automatically carried out reliably and rapidly. Therefore, theerroneous operation of the programmable controller caused by mistakes inthe checking can be prevented from occurring.

When a check is performed to confirm whether or not devices connected bydevice notations indicating consecutive areas or commands specifyingconsecutive devices in a sequence program are being used independentlyby other commands present in the sequence program, an instruction for afirst device overlapping use check is given from the keyboard 17 via thekey input control section 14. By this instruction, the processingsection 11 runs the first device overlapping use checking module 32 inthe system program.

The check routine using the first device overlapping use checking module32 will now be described while referring to FIG. 8.

When a check instruction is sent, firstly, a processing to set thedestination of the reference by the sequence program copy source to thefirst command (the command on the examining side of overlapping usedevice) is performed (step S41). As a result, the first command is setas the destination of the reference by the copy source. A processing tocopy one command and device from the sequence program to the first workarea is then performed (step S42), and the one command and device arecopied to the first work area.

A processing to determine whether-or not one command and device copiedto the first work area are a command specifying a device indicatingconsecutive areas or a device notation is then performed (step S43). Ifthey are neither a command specifying a device indicating consecutiveareas nor a device notation, a processing to set the destination of thereference by the sequence program copy source to the next command isperformed (step S44). By this processing, the destination of thereference by the sequence program copy source is set to the nextcommand. The routine is then repeated from the processing to copy onecommand and device from the sequence program to the work area (stepS42). This corresponds to a scan of the commands on the examination sideof overlapping use devices.

If, however, one command and device copied to the first work area are acommand specifying a device indicating consecutive areas or a devicenotation, a processing to fetch the device is performed (step S45), andthe device alone is fetched from one command and device. The processingto fetch the device (expansion processing) is performed in accordancewith the processing routine shown in FIG. 3, in the same way as thecombined local/global device use check, and an explanation thereof isomitted here.

A processing to set the destination of the reference by the sequenceprogram copy source to the first command (the command on the side of thecomparison with the overlapping use device) is then performed (stepS46). By this processing, the first command is set as the destination ofthe reference by the copy source. A processing to copy one command anddevice from the sequence program to the second work area is thenperformed (step S47).

A processing to fetch the device from one command and device copied tothe second work area is then performed (step S48).

An overlapping use determination is then made as to whether or not thedevice fetched from one command and device in the second work area iswithin the consecutive areas of one command and device of the first workarea (step S49).

If the device is within the areas, a processing to save the results asprintout data and screen display data is performed (step S50). By thisprocessing, the printout data and screen display data are created andadded.

A processing to determine whether or not a command on the side of thecomparison with the overlapping use device is still present is thenperformed (step S51). If a command is still present, a processing to setthe destination of the reference by the sequence program copy source tothe next command is performed (step S52). By this processing, thedestination of the reference by the sequence program copy source is setto the next command. The routine is then repeated from the processing tocopy one command and device from the sequence program to the second workarea (step S47). This corresponds to a scan of the commands on the sideof the comparison with the overlapping use device.

Once the command on the side of the comparison with the overlapping usedevice has ended, a processing to determine whether or not a command isstill present on the overlapping use device examination side isperformed (step S53). If a command is still present, the processing toset the destination of the reference by the sequence program copy sourceto the next command is performed (step S44), and the destination of thereference by the sequence program copy source is set to the nextcommand. The routine is then repeated from the processing to copy onecommand and device from the sequence program to the first work area(step S42).

Once the checking has been completed for all sequence programs, thesaved results (check results) are output to the CRT 18 via the screencontrol section 15 and to the printer 19 via the printer control section16 (step S54).

The output results comprise numbers (list lines) where overlappingdevices, commands specifying devices indicating consecutive areas, anddevice notations in which the devices are used independently by othercommands are present as well as the commands.

When the above-described check is performed for the sequence programshown in FIG. 9, the third command “MOV K4M92 D12” includes the notation“K” of a device indicating consecutive areas. In this command, as isshown in FIG. 10, “4” is extracted in the processing to extract thenumerical values following the first character “K” of the device portion“K4M92 D12” following the command portion “MOV” and the range ofconsecutive devices “K1” to “K4” is acquired. The devices “M92” to“M107” are allocated to the range of consecutive devices “K1” to “K4”.

Relative to this, because, in the fifth command “OUT M100”, the “M100”is being used independently, it is determined that the devices “M92” to“M107” of the consecutive areas overlap with the “M100” of the fifthcommand “OUT M100”.

Further, the seventh command “BMOV D45 D10 K10” is a command indicatingconsecutive areas (a transfer command). As is shown in FIG. 11, thedevices “D10” to “D19” indicating consecutive areas of the destinationof the transfer are here acquired in accordance with his command.

Relative to this, because, in the third command “MOV K4M92 D12”, the“D12” is being used independently, it is determined that the devices“D10” to “D19” of the consecutive areas overlap with the “D12” of thethird command “MOV K4M92 D12”.

As a result, the check results are displayed on a screen as is shown inFIG. 12.

Accordingly, the check as to whether or not devices connected by devicenotations indicating consecutive areas or commands specifyingconsecutive devices in a sequence program are being used independentlyby other commands present in the sequence program can be automaticallyperformed reliably and rapidly without the necessity of the visualconfirmation of the sequence program itself. The erroneous operation ofthe programmable controller caused by mistakes in the checking can thusbe prevented from occurring.

When checking whether or not index modified results of commandsspecifying index modification devices present in the sequence programare being used by other commands present in the sequence program, aninstruction for a second device overlapping use check is given from thekeyboard 17 via the key input control section 14. In addition, the rangeto be index modified (the index modification range Z=0 to 10) is alsoinput. By this instruction, the processing section 11 runs the seconddevice overlapping use check module 33 in the system program.

The check routine using the second device overlapping use checkingmodule 33 will now be described while referring to FIG. 13.

When a check instruction is sent, a processing to set the destination ofthe reference by the sequence program copy source to the first commandis performed (the command on the examination side of the overlapping usedevice) (step S61). By this processing, the first command is set as thedestination of the reference by the copy source. A processing to copyone command and device from the sequence program to the first work areais then performed (step S62). With this process, the one command anddevice are copied to the first work area.

A process to determine whether or not one command and device copied tothe first work area are a command including an index modified device isthen performed (step S63).

If they are not a command including an index modified device, aprocessing to set the destination of the reference by the sequenceprogram copy source to the next command is performed (step S64). Withthis process, the destination of the reference by the sequence programcopy source is set to the next command. The routine is then repeatedfrom the processing to copy one command and device from the sequenceprogram to the work area (step S62).

If, however, one command and device copied to the first work area are acommand which includes an index modified device, a processing to fetchthe minimum and maximum values of the retrieval device is performed(step S65). With this process, the minimum and maximum values of theretrieval device are fetched from one command and device.

The processing to fetch the minimum and maximum values of the retrievaldevice is now described while referring to FIG. 14.

A processing to disassemble a character string following one command anddevice into character string groups with no spaces and so that thespaces become keys is performed (step S81). With this process, a devicesection is disassembled into each device.

A process to determine whether or not the last character of a characterstring of a disassembled device is a notation of an index device is thenperformed (i.e. is “Z” or not) (step S82).

If the last character is not “Z”, a processing to determine whether ornot extraction has been performed for all character string groups isperformed (step S85). If extraction has been performed for all characterstring groups, the routine is ended. If, however, extraction has beenperformed for only a portion of the character string groups, theprocessing to determine whether or not the last character of a characterstring is “Z” (step S82) is repeated for all the devices in the deviceportion.

If the last character is “Z”, the device value before “Z” is extractedand set as the minimum value of the retrieval device (step S83).

The index modification range (Z=10), which is the maximum value of Zinput using the keyboard, is added to the extracted device value andthis is set as the maximum value of the retrieval device (step S84).

A process to determine whether or not extraction has been performed forall character string groups is then performed (step S85). The processingto determine whether or not the final letter of a character string is“Z” (step S82) is repeated until it is performed for all the devicesincluded in the device section with the result that the processing isrepeatedly performed for all the devices.

The processing to fetch the minimum and maximum values of the retrievaldevice is completed by the above procedure. Once the processing to fetchthe minimum and maximum values of the retrieval device is completed, aprocessing (the description returns here to FIG. 13) to set thedestination of the reference by the sequence program copy source to thefirst command (the command on the side of the comparison with theoverlapping use device) is performed (step S66). Consequently, the firstcommand is set as the destination of the reference by the copy source. Aprocessing to copy one command and device from the sequence program tothe second work area is then performed (step S67).

A processing to fetch the device from the one command and device copiedto the second work area is then performed (step S68).

An overlapping use determination is performed as to whether or not thedevice fetched from the one command and device in the second work areais within the retrieval area of the device of the one command and deviceof the first work area (the command which includes the index modifieddevice) (step S69).

If it is within the retrieval area, a processing to save the results asprintout data and screen display data is performed (step S70). With thisprocess, printout data and screen data are created and added.

A processing to determine whether or not a command on the side of thecomparison with the overlapping use device is still present is thenperformed (step S71). If a command is still present, a processing to setthe destination of the reference by the sequence program copy source tothe next command is performed (step S72). With this process, thedestination of the reference by the sequence program copy source is setto the next command. The routine is then repeated from the processing tocopy one command and device from the sequence program to the second workarea (step S67).

Once the command on the side of the comparison with the overlapping usedevice is ended, a processing to determine whether or not a command onthe overlapping use device examination side is still present isperformed (step S73). If the command is still present, the processing toset the destination of the reference by the sequence program copy sourceto the next command is performed (step S64), and the destination of thereference by the sequence program copy source is set to the nextcommand. The routine is then repeated from the processing to copy onecommand and device from the sequence program to the first work area(step S62).

Once checking of all sequence programs has ended, the saved results(check results) are output to the CRT 18 via the screen control section15 and to the printer 19 via the printer control section 16 (step S74).

Index modified devices, commands overlapping the index modified results,and the commands are outputted in the output results.

When the above check is performed for the sequence program shown in FIG.15, the first command “MOV D10Z D100” is a command specifying an indexmodification device. As is shown in FIG. 16, the minimum value “D10” andmaximum value “D19” of a retrieval device are fetched and the deviceretrieval range “D10” to “D19” is acquired.

Relative to this, because “D10” is used in the third command “MOV D10D120” and “D19” is used in the fifth command MOV D19 D219”, the indexmodified result of “MOV D10Z D100” is determined to be usedoverlappingly with the devices used in the third and fifth commands.

When the same process is performed for the ninth command “MOV W20ZW200”, the index modified result is determined to be used overlappinglywith the device used in the eleventh command.

The result of this is that check results, such as those shown in FIG.17, are displayed on the screen.

Accordingly, the check as to whether or not the index modified result ofa command specifying an index modification device present in a sequenceprogram is used by another command present in the sequence program canbe automatically performed reliably and rapidly without the necessity ofthe task of visually confirming the sequence program itself, anderroneous operation by the programmable controller due to checkingmistakes can be evaded beforehand.

INDUSTRIAL APPLICABILITY

A peripheral device for creating a sequence program for a programmablecontroller for controlling mechanical equipment can be used forautomatically checking the sequence program.

1. A peripheral device for a programmable controller comprising: asystem program area which stores a system program; a sequence programarea which stores a sequence program; a processing section whichsequentially extracts device notations indicating consecutive areas andcommands specifying consecutive devices present in the sequence programof said system program area by running the system program stored in saidsystem program area, expands the devices of corresponding consecutiveareas, compares said devices in the consecutive areas with a device usedby other commands present in an identical sequence program, and reportsa result of comparison.
 2. The peripheral device according to claim 1,wherein said processing section checks an overlapping use of devices bycomparing the devices whose index has been modified by the indexmodification devices present in a sequence program with devices used byother commands present in an identical sequence program.